package dryven.persistence.provider;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Enumeration;

public class TempClassLoader extends ClassLoader {
	
	private TempImplClassLoader _innerLoader;
	
	public TempClassLoader(ClassLoader parent) {
		super();
		_innerLoader = new TempImplClassLoader(parent);
	}
	
	public void dispose() {
		_innerLoader = null;
	}

	public int hashCode() {
		return _innerLoader.hashCode();
	}

	public boolean equals(Object obj) {
		return _innerLoader.equals(obj);
	}

	public Class<?> loadClass(String name) throws ClassNotFoundException {
		return _innerLoader.loadClass(name);
	}

	public String toString() {
		return _innerLoader.toString();
	}

	public URL getResource(String name) {
		return _innerLoader.getResource(name);
	}

	public Enumeration<URL> getResources(String name) throws IOException {
		return _innerLoader.getResources(name);
	}

	public InputStream getResourceAsStream(String name) {
		return _innerLoader.getResourceAsStream(name);
	}

	public void setDefaultAssertionStatus(boolean enabled) {
		_innerLoader.setDefaultAssertionStatus(enabled);
	}

	public void setPackageAssertionStatus(String packageName, boolean enabled) {
		_innerLoader.setPackageAssertionStatus(packageName, enabled);
	}

	public void setClassAssertionStatus(String className, boolean enabled) {
		_innerLoader.setClassAssertionStatus(className, enabled);
	}

	public void clearAssertionStatus() {
		_innerLoader.clearAssertionStatus();
	}
}

class TempImplClassLoader extends ClassLoader {
	public TempImplClassLoader(ClassLoader parent) {
		super(parent);
	}
}
